package com.qian.ddj.web.controller;

import com.qian.api.ddj.model.CountQueryModel;
import com.qian.api.ddj.service.ICountQueryService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/ddj/countQuery")
@Api(tags = "统计查询")
public class CountQueryController {

    @Autowired
    private ICountQueryService countQueryService;

    @GetMapping("/all")
    public List<CountQueryModel> findAll(CountQueryModel model) {
//        String json = JSON.toJSONString();
//        System.out.println(json);
        return countQueryService.find(model);

    }

    @GetMapping("/businessCount")
    public List<CountQueryModel> findOfBusiness(CountQueryModel model) {
        return countQueryService.findOfBusiness(model);
    }
}
